package com.tiancheng.trade.settlement.controller.admin;

import com.tiancheng.trade.commom.core.data.Result;
import com.tiancheng.trade.settlement.service.settlement.ISettleDetailService;
import com.tiancheng.trade.settlement.vo.settlement.admin.SettleDetailQueryVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.validation.Valid;

/**
 * 收入成本明细报表
 *
 * @author lzh
 */
@RestController
@RequestMapping("/admin/settleDetail")
@Validated
@Slf4j
public class SettleDetailAdminController {

    @Autowired
    private ISettleDetailService settleDetailService;

    /**
     * 异常数据明细
     *
     * @param detailQueryVo
     * @return
     */
    @GetMapping("/list")
    public Result listSettleDetail(@Valid SettleDetailQueryVo detailQueryVo) {
        return Result.success(settleDetailService.findList(detailQueryVo));
    }

    /**
     * 遗产该数据汇总
     *
     * @param checkCode
     * @return
     */
    @GetMapping("/settleException/{checkCode}")
    public Result exportAll(@PathVariable("checkCode") String checkCode) {
        return Result.success(settleDetailService.findExceptionData(checkCode));
    }

}
